function lend(){
	if(objs.length==0){
		sys_alert('错误提示', '请选择物品再进行调出', 'error');
		return;
	}
	greyLayer.open();
	win_func.window('open');
	form_func.form('clear');
	$('#selectTcode').val(objs[0]);
}
function search(){
	var queryParams = $('#tt').datagrid('options').queryParams;
	//type用来在后台判断是否点击按钮提交
	queryParams["type"] = 'search';
	//把页面中form 查询条件在这里补齐，queryParams["AJBH"] 的AJBH是提交得名字通过request.getParameter("AJBH")获得值,同jquery 发送ajax请求类似
	queryParams["AJMC"] = $('#AJMC').val();
	queryParams["WPMC"] = $('#WPMC').val();
	queryParams["BADW"] = $('#BADW').val();
	queryParams["BAR"] = $('#BAR').val();
	$('#tt').datagrid('options').pageNumber = 1;
	$('#tt').datagrid('reload');
}
function setUpSelect(rowIndex,rows,condition){
	var b = true;
	var start = parseInt(rowIndex);
	while(b){
		start = parseInt(start)-1;
		if(start<0){
			b = false;
		}else{
			if(rows[start].t_code==condition){
				grid.datagrid('selectRow', start);
			}else{
				b = false;
			}
		}
	}
}
function setUpUnSelect(rowIndex,rows,condition){
	var b = true;
	var start = parseInt(rowIndex);
	while(b){
		start = parseInt(start)-1;
		if(start<0){
			b = false;
		}else{
			if(rows[start].t_code==condition){
				grid.datagrid('unselectRow', start);
			}else{
				b = false;
			}
		}
	}
}
function setDownSelect(rowIndex,rows,condition){
	var b = true;
	var start = parseInt(rowIndex);
	while(b){
		start = parseInt(start)+1;
		if(start>rows.length){
			b=false;
		}else{
			if(rows[start].t_code==condition){
				grid.datagrid('selectRow', start);
			}else{
				b = false;
			}
		}
	}
}
function setDownUnSelect(rowIndex,rows,condition){
	var b = true;
	var start = parseInt(rowIndex);
	while(b){
		start = parseInt(start)+1;
		if(start>rows.length){
			b=false;
		}else{
			if(rows[start].t_code==condition){
				grid.datagrid('unselectRow', start);
			}else{
				b = false;
			}
		}
	}
}
function doSave(){
	var lend_person = $('#lend_person').val();
	var lend_company = $('#lend_company').val();
	var lend_limit = $('#lend_limit').val();
	var lend_reason = $('#lend_reason').val();
	form_func.form("submit",{
		url:proName+'/casePropertyLend/doUnStoredGoods?lend_person='+lend_person+'&lend_company='+lend_company+'&lend_limit='+lend_limit+'&lend_reason='+lend_reason,
		success:function(data){
			eval('data=' + data);
			if (data.success) {
				grid.datagrid('reload');
				win_func.window('close');
				greyLayer.close();
				objs = [];
			} else {
				sys_alert('错误提示', data.msg, 'error');
			}
		}
	});
}